Hệ thống xếp lịch học tín chỉ cho sinh viên CNTT trên PHP & MySQL
112.215 lượt xem;
1 <?php
2 $currDir = dirname(__FILE__);
3 require("{$currDir}/incCommon.php");
4 $GLOBALS['page_title'] = $Translation['rebuild thumbnails'];
5 include("{$currDir}/incHeader.php");
6
7 // image paths
8 $p=array(
9 );
10
11 if(!count($p)) exit;
12
13 // validate input
14 $t=$_GET['table'];
15 if(!in_array($t, array_keys($p))){
16 ?>
17 <div class="page-header"><h1><?php echo $Translation['rebuild thumbnails']; ?></h1></div>
18 <form method="get" action="pageRebuildThumbnails.php" target="_blank">
19 <?php echo $Translation['thumbnails utility']; ?><br><br>
20
21 <b><?php echo $Translation['rebuild thumbnails of table'] ; ?></b>
22 <?php echo htmlSelect('table', array_keys($p), array_keys($p), ''); ?>
23 <input type="submit" value="<?php echo $Translation['rebuild'] ; ?>">
24 </form>
25
26
27 <?php
28 include("{$currDir}/incFooter.php");
29 exit;
30 }
31
32 ?>
33 <div class="page-header"><h1><?php echo str_replace ( "<TABLENAME>" , $t , $Translation['rebuild thumbnails of table_name'] ); ?></h1></div>
34 <?php echo $Translation['do not close page message'] ; ?><br><br>
35 <div style="font-weight: bold; color: red; width:700px;" id="status"><?php echo $Translation['rebuild thumbnails status'] ; ?></div>
36 <br>
37
38 <div style="text-align:left; padding: 0 5px; width:700px; height:250px;overflow:auto; border: solid 1px green;">
39 <?php
40 foreach($p[$t] as $f=>$path){
41 $res=sql("select `$f` from `$t`", $eo);
42 echo str_replace ( "<FIELD>" , $f , $Translation['building field thumbnails'] )."<br>";
43 unset($tv); unset($dv);
44 while($row=db_fetch_row($res)){
45 if($row[0]!=''){
46 $tv[]=$row[0];
47 $dv[]=$row[0];
48 }
49 }
50 for($i=0; $i<count($tv); $i++){
51 if($i && !($i%4)) echo '<br style="clear: left;">';
52 echo '<img src="../thumbnail.php?t='.$t.'&f='.$f.'&i='.$tv[$i].'&v=tv" align="left" style="margin: 10px 10px;"> ';
53 }
54 echo '<br style="clear: left;">';
55
56 for($i=0; $i<count($dv); $i++){
57 if($i && !($i%4)) echo '<br style="clear: left;">';
58 echo '<img src="../thumbnail.php?t='.$t.'&f='.$f.'&i='.$tv[$i].'&v=dv" align="left" style="margin: 10px 10px;"> ';
59 }
60 echo "<br style='clear: left;'>{$Translation['done']}<br><br>";
61 }
62 ?>
63 </div>
64
65 <script>
66 window.onload = function(){
67 document.getElementById('status').innerHTML = "<?php echo $Translation['finished status'] ; ?>";
68 document.getElementById('status').style.color = 'green';
69 document.getElementById('status').style.fontSize = '25px';
70 document.getElementById('status').style.backgroundColor = '#fff4cf';
71 }
72 </script>
73
74 <?php
75 include("{$currDir}/incFooter.php");
2 $currDir = dirname(__FILE__);
3 require("{$currDir}/incCommon.php");
4 $GLOBALS['page_title'] = $Translation['rebuild thumbnails'];
5 include("{$currDir}/incHeader.php");
6
7 // image paths
8 $p=array(
9 );
10
11 if(!count($p)) exit;
12
13 // validate input
14 $t=$_GET['table'];
15 if(!in_array($t, array_keys($p))){
16 ?>
17 <div class="page-header"><h1><?php echo $Translation['rebuild thumbnails']; ?></h1></div>
18 <form method="get" action="pageRebuildThumbnails.php" target="_blank">
19 <?php echo $Translation['thumbnails utility']; ?><br><br>
20
21 <b><?php echo $Translation['rebuild thumbnails of table'] ; ?></b>
22 <?php echo htmlSelect('table', array_keys($p), array_keys($p), ''); ?>
23 <input type="submit" value="<?php echo $Translation['rebuild'] ; ?>">
24 </form>
25
26
27 <?php
28 include("{$currDir}/incFooter.php");
29 exit;
30 }
31
32 ?>
33 <div class="page-header"><h1><?php echo str_replace ( "<TABLENAME>" , $t , $Translation['rebuild thumbnails of table_name'] ); ?></h1></div>
34 <?php echo $Translation['do not close page message'] ; ?><br><br>
35 <div style="font-weight: bold; color: red; width:700px;" id="status"><?php echo $Translation['rebuild thumbnails status'] ; ?></div>
36 <br>
37
38 <div style="text-align:left; padding: 0 5px; width:700px; height:250px;overflow:auto; border: solid 1px green;">
39 <?php
40 foreach($p[$t] as $f=>$path){
41 $res=sql("select `$f` from `$t`", $eo);
42 echo str_replace ( "<FIELD>" , $f , $Translation['building field thumbnails'] )."<br>";
43 unset($tv); unset($dv);
44 while($row=db_fetch_row($res)){
45 if($row[0]!=''){
46 $tv[]=$row[0];
47 $dv[]=$row[0];
48 }
49 }
50 for($i=0; $i<count($tv); $i++){
51 if($i && !($i%4)) echo '<br style="clear: left;">';
52 echo '<img src="../thumbnail.php?t='.$t.'&f='.$f.'&i='.$tv[$i].'&v=tv" align="left" style="margin: 10px 10px;"> ';
53 }
54 echo '<br style="clear: left;">';
55
56 for($i=0; $i<count($dv); $i++){
57 if($i && !($i%4)) echo '<br style="clear: left;">';
58 echo '<img src="../thumbnail.php?t='.$t.'&f='.$f.'&i='.$tv[$i].'&v=dv" align="left" style="margin: 10px 10px;"> ';
59 }
60 echo "<br style='clear: left;'>{$Translation['done']}<br><br>";
61 }
62 ?>
63 </div>
64
65 <script>
66 window.onload = function(){
67 document.getElementById('status').innerHTML = "<?php echo $Translation['finished status'] ; ?>";
68 document.getElementById('status').style.color = 'green';
69 document.getElementById('status').style.fontSize = '25px';
70 document.getElementById('status').style.backgroundColor = '#fff4cf';
71 }
72 </script>
73
74 <?php
75 include("{$currDir}/incFooter.php");